package com.hashTable;

public class ValidAnagram0130_242 {
    public boolean isAnagram(String s, String t) {
        int[] has = new int[26];

        for (int i = 0; i < s.length(); i++) {
            has[s.charAt(i) - 'a']++;
        }

        for (int i = 0; i < t.length(); i++) {
            has[t.charAt(i) - 'a']--;
        }

        for (int ha : has) {
            if(ha != 0) return false;
        }
        return true;
    }

}
